/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ServicesAccessData;

import org.apache.thrift.server.TNonblockingServer;
import org.apache.thrift.server.TServer;
import org.apache.thrift.transport.TNonblockingServerSocket;
import org.apache.thrift.transport.TNonblockingServerTransport;
import org.apache.thrift.transport.TTransportException;

/**
 *
 * @author ngochuy
 */
public class NonblockingServerAdmin {
    private void start() {
        try {
            TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(7912);
            Admin.Processor processor = new Admin.Processor(new AdminImpl());

            TServer server = new TNonblockingServer(new TNonblockingServer.Args(serverTransport).processor(processor));
            System.out.println("Starting server on port 7912 ...");
            server.serve();
        } catch (TTransportException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        NonblockingServerAdmin srv = new NonblockingServerAdmin();
        srv.start();
    }
}
